package com.example.config;

import com.example.config.TransactionMessageHandler;
import com.example.message.User;
import org.springframework.stereotype.Component;

/**
 * @author zxs
 * @since 2021/5/27
 */
@Component
public class DefaultTransactionMessageHandler implements TransactionMessageHandler {

    @Override
    public boolean handleMessage(String id,Object msg) {
        User u = (User) msg;
        //DO SOMETHING
        return true;
    }

    @Override
    public boolean support(Object msg) {

        return msg instanceof User;
    }
}
